public class Cook extends Thread{
    public void run(){
        while(true) {
            synchronized(Desk.lock) {
                if(Desk.count == 0) {
                    break;
                } else {
                    if(Desk.foodFlag == true) {
                        try {
                            Desk.lock.wait();
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                    } else {
                        System.out.println("面已经做好了");
                        Desk.foodFlag = true;
                        Desk.lock.notifyAll();
                    }
                }
            }
        }
    }
}
